<div class="container-fluid">

  <div class="row">
    <div class="col-md-12 vertically-padded">
      <div class="panel panel-default">
        <div class="panel-body">
          <!-- NOTE: approval-object is an out-binding.
               It is set by grr-approval-info when the approval object is fetched. -->
          <grr-approval-info approval-type="'hunt'"
                             username="controller.username"
                             object-id="controller.huntId"
                             approval-id="controller.approvalId"

                             approval-object="controller.approvalObject">
          </grr-approval-info>

          <span class="text-danger" ng-if="controller.approvalObject &&
                                           !controller.approvalObject.value.copied_from_hunt &&
                                           !controller.approvalObject.value.copied_from_flow">
            This hunt is new. It wasn't copied from another hunt and wasn't created from a flow. <strong>Make sure it is safe to run!</strong>
          </span>
        </div>
      </div>
    </div>
  </div>


  <div ng-if="controller.approvalObject.value.copied_from_hunt">
    <div class="row">
      <div class="col-md-12">
        <div class="panel panel-default">
          <div class="panel-body">
            <h3>This hunt was copied from <grr-semantic-value value="controller.approvalObject.value.copied_from_hunt.value.hunt_id"></grr-semantic-value></h3>

            <grr-hunt-from-hunt-copy-review source-hunt="controller.approvalObject.value.copied_from_hunt"
                                            new-hunt="controller.approvalObject.value.subject">
            </grr-hunt-from-hunt-copy-review>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div ng-if="controller.approvalObject.value.copied_from_flow">
    <div class="row">
      <div class="col-md-12">
        <div class="panel panel-default">
          <div class="panel-body">
            <!-- grr-client-context is needed to render the flow ID link correctly. -->
            <grr-client-context client-id="controller.approvalObject.value.copied_from_flow.value.client_id.value">
              <h3>This hunt was created from a flow <grr-semantic-value value="controller.approvalObject.value.copied_from_flow.value.flow_id"></grr-semantic-value></h3>

              <grr-hunt-from-flow-copy-review source-flow="controller.approvalObject.value.copied_from_flow"
                                              new-hunt="controller.approvalObject.value.subject">
              </grr-hunt-from-flow-copy-review>
            </grr-client-context>
          </div>
        </div>
      </div>
    </div>
  </div>


  <div class="row" ng-show="controller.approvalObject">
    <div class="col-md-12">
      <div class="panel panel-default">
        <div class="panel-body">
          <h3>Hunt overview</h3>
          <grr-hunt-overview hunt-id="controller.huntId">
          </grr-hunt-overview>
        </div>
      </div>
    </div>
  </div>
</div>
